//
//  XMApplicationForCashViewController.m
//  MyNewProject
//
//  Created by ZhangYuan on 2019/1/30.
//  Copyright © 2019年 sun. All rights reserved.
//

#import "XMApplicationForCashViewController.h"
#import "RealNameViewController.h"
@interface XMApplicationForCashViewController ()
@property(nonatomic , retain)UITextField * moneyNum;//金额
@property(nonatomic , retain)UIButton * makeSure;//确认支付
@end

@implementation XMApplicationForCashViewController
//-(void)LoadRightButtonItem{
//    UIButton  * customBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, SKStatusBar_Height, 60, 44)];
//    [customBtn setTitle:@"明细" forState:UIControlStateNormal];
//    [customBtn setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
//    [customBtn addTarget:self action:@selector(customBtnPress) forControlEvents:UIControlEventTouchUpInside];
//    self.gk_navRightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:customBtn];
//}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.gk_navigationBar.hidden = NO;
    self.gk_navTitle = @"提现";
//    [self LoadRightButtonItem];
    self.view.backgroundColor = BackColor;
    
    UIView * whiteView = [[UIView alloc]initWithFrame:CGRectMake(0,  SKTopBar_Height, SCREEN_WIDTH, 0)];
    whiteView.backgroundColor  = [UIColor whiteColor];
    [self.view addSubview:whiteView];

    UIView * lineView1 = [[UIView alloc]initWithFrame:CGRectMake(0,  0, SCREEN_WIDTH, 11)];
    lineView1.backgroundColor  = BackColor;
    [whiteView addSubview:lineView1];

    UILabel * tipLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 11, 90, 56)];
    tipLabel.textColor = SKColorWithHex(0x444444);
    tipLabel.textAlignment = NSTextAlignmentLeft;
    tipLabel.text = @"支付宝账号";
    tipLabel.font = SKFONT_Medium(15);
    [whiteView addSubview:tipLabel];



    UILabel * accountLab = [[UILabel alloc]initWithFrame:CGRectMake(tipLabel.right +10, 11, SCREEN_WIDTH - 15-16-6-10 -90 -10, 56)];
    accountLab.textAlignment = NSTextAlignmentRight;
    accountLab.text = @"二个是傻逼";
    accountLab.font = SKFONT_Medium(15);

    [whiteView addSubview:accountLab];



    UIImageView * img = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 16 -6, tipLabel.top + (tipLabel.height - 11)/2, 6, 11)];
    img.image = SKIMAGE_NAMED(@"rightArrow");
    [whiteView addSubview:img];


    UIView * grayViewtipLabel = [[UIView alloc]initWithFrame:CGRectMake(0,  tipLabel.bottom, SCREEN_WIDTH, 42)];
    grayViewtipLabel.clipsToBounds = YES;
    grayViewtipLabel.layer.cornerRadius = 5;
    grayViewtipLabel.backgroundColor  = BackColor;
    [whiteView addSubview:grayViewtipLabel];

    UILabel * tipLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH - 30, grayViewtipLabel.height)];
    tipLabel1.textColor = SKColorWithHex(0x999999);
    tipLabel1.text = [NSString stringWithFormat:@"当前账户最多可提现余额:%.2lf",[[UserInfoSingleton shareInstance].userInfo.yue floatValue]];
    tipLabel1.font = SKFONT_Medium(13);
    tipLabel.textAlignment = NSTextAlignmentLeft;
    [grayViewtipLabel addSubview:tipLabel1];

//    UIView * grayView = [[UIView alloc]initWithFrame:CGRectMake(15,  95, SCREEN_WIDTH - 30, 60)];
//    grayView.clipsToBounds = YES;
//    grayView.layer.cornerRadius = 5;
//    grayView.backgroundColor  = BackColor;
//    [whiteView addSubview:grayView];




    UILabel * moneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, grayViewtipLabel.bottom, 70, 56)];
    moneyLabel.text = @"提现金额";
    moneyLabel.textColor = SKColorWithHex(0x444444);
    moneyLabel.textAlignment = NSTextAlignmentLeft;
    moneyLabel.font = SKFONT_Medium(15);

    [whiteView addSubview:moneyLabel];


  _moneyNum = [[UITextField alloc]initWithFrame:CGRectMake(moneyLabel.right +10, moneyLabel.top, SCREEN_WIDTH - moneyLabel.right -10 -15, moneyLabel.height)];
    NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"请输入您要提现的金额" attributes: @{NSForegroundColorAttributeName:SKColorWithHex(0x999999),
                                                                                                    NSFontAttributeName:SKFONT_Semibold(15)
                                                                                                    }];
    _moneyNum.attributedPlaceholder = attrString;


    _moneyNum.textColor = SKColorWithHex(0x444444);
    _moneyNum.font = SKFONT_Medium(15);

    [whiteView addSubview:_moneyNum];


    whiteView.height = _moneyNum.bottom;

    [self.view addSubview:self.makeSure];



    //TODO:  0 没有支付宝号  1 支付宝号
    if (1) {
        accountLab.textColor = SKColorWithHex(0x444444);
        UIButton * clearButton = [UIButton buttonWithType:UIButtonTypeCustom];
        clearButton.backgroundColor = [UIColor clearColor];
        clearButton.frame = CGRectMake(0, tipLabel.top, SCREEN_WIDTH, tipLabel.height);
        [clearButton addTarget:self action:@selector(clearButtonPress) forControlEvents:UIControlEventTouchUpInside];
        [whiteView addSubview:clearButton];

    }
    else
    {
        accountLab.textColor = SKColorWithHex(0x999999);

    }

}
-(void)makeSurePress{
    //self.moneyNum.text   提现金额
    
}
//-(void)customBtnPress{
//    XMAccountDetailViewController * accVC = [[XMAccountDetailViewController alloc]init];
//    [self.navigationController pushViewController:accVC animated:YES];
//}
-(void)clearButtonPress{
    RealNameViewController * accVC = [[RealNameViewController alloc]init];
    accVC.myVC = ALIPAY;
    [self.navigationController pushViewController:accVC animated:YES];
}
//-(UITextField *)moneyNum{
//    if (!_moneyNum) {
//        _moneyNum = [[UITextField alloc]initWithFrame:CGRectMake(30, 10, SCREEN_WIDTH - 80, 40)];
//    }
//    return _moneyNum;
//}
-(UIButton *)makeSure{
    if (!_makeSure) {
        _makeSure = [UIButton buttonWithType:UIButtonTypeCustom];
        _makeSure.frame = CGRectMake(0, SCREENH_HEIGHT- SKBottomSafe_Height-50, SCREEN_WIDTH , 50);
        _makeSure.backgroundColor = SKColorWithHex(0x7ab801);

        [_makeSure setTitle:@"立即提现" forState:UIControlStateNormal];
        [_makeSure setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _makeSure.titleLabel.font = SKFONT_Semibold(15);
        [_makeSure addTarget:self action:@selector(makeSurePress) forControlEvents:UIControlEventTouchUpInside];
    }
    return _makeSure;
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];

}
@end
